$("#advertisementForm").validate({
    rules: {
    	title:'required',
    	categoryId: 'required'
    },
    messages: {
        title: {
            required: "请输入广告实体名称"
        },
        categoryId: {
            required: "请选择广告类别分类"
        }
    }
});
$(function(){
    // 初始化上传组件
    $('#fileupload').fileupload({
        dataType : 'json',
        done : function(e, data) {
            if (data.result.status == 'ok') {
                $('#js_url').val(data.result.url);
                $('#preview').attr('src', data.result.url);
            }
        }
    });
});

